Sliding Puzzle Solver Algorithm